<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="../templates/principal.xhtml">

    <ui:define name="content" id="content">
        <h:form id="frmExportar">
            <p:panel id="panel" header="Bem Vindo a Exportação para Excel">
                <p:growl id="messages" life="5000" showDetail="true" />

                <p:tooltip />
                <p:panel id="panelStatus" header="Definição dos Filtros"  collapsed="#{exportarBean.fechafiltro}" toggleable="true" toggleSpeed="500" closeSpeed="500" widgetVar="wpanelStatus" style="margin-bottom:20px">
                    <p:ajax event="toggle" listener="#{exportarBean.onToggle}" update=":frmExportar:panel" />
                    <p:panelGrid id="pnStatus" style="width: 100%;">
                        <p:row>
                            <p:column style="text-align: left; vertical-align: text-top;">
                                <p:fieldset id="fsCampos" legend="Escolha de Campos">
                                    <h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
                                        <p:selectBooleanCheckbox value="#{exportarBean.todos}">
                                            <p:ajax listener="#{exportarBean.atualizaTodos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Todos Proposta" style="font-weight:bold;" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.empresa}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Empresa" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.numos}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Numero O.S." />
                                        <p:selectBooleanCheckbox value="#{exportarBean.numprocesso}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Numero Processo" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.orgao}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Orgão" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.assunto}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Assunto Processo" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.statusprocesso}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Situação Processo" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.razsoc}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Razão Social/Nome" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.fantasia}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Nome Fantasia/Sobrenome" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.cnpjcliente}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - C.N.P.J./C.P.F. Cliente" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.empreendimento}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Empreendimento" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.cnpjempreendimento}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - C.N.P.J./C.P.F. Empreendimento" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.dscproposta}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Descriçao Proposta" />

                                        <p:selectBooleanCheckbox value="#{exportarBean.statusproposta}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Status Proposta" />

                                        <p:separator style="width:18px;" />
                                        <p:separator style="width:100%;" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.todosos}">
                                            <p:ajax listener="#{exportarBean.atualizaTodosOs}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Todos Ordem de Serviço" style="font-weight:bold;" />

                                        <p:selectBooleanCheckbox value="#{exportarBean.etapa}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Etapa" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.assuntoos}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Assunto Etapa" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.vlretapa}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Valor Etapa" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.percpagto}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - % Pagto." />
                                        <p:selectBooleanCheckbox value="#{exportarBean.evento}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Evento" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.nf}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Nota Fiscal" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.datemiss}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Data Emissão" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.datvcto}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Data Vencimento" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.datpagto}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Data Pagto." />
                                        <p:selectBooleanCheckbox value="#{exportarBean.vlrbruto}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Valor Bruto" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.vlrjuros}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Valor Juros" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.vlrmulta}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Valor Multa" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.vlrreceb}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Valor Recebido" />
                                        <p:selectBooleanCheckbox value="#{exportarBean.vlrterc}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Valor Terceiro" />

                                        <p:selectBooleanCheckbox value="#{exportarBean.statusetapa}">
                                            <p:ajax listener="#{exportarBean.atualizaCampos}" />
                                        </p:selectBooleanCheckbox>
                                        <h:outputText value=" - Status Etapa" />
                                    </h:panelGrid>
                                </p:fieldset>
                            </p:column>
                            <p:column style="text-align: left; vertical-align: text-top;">
                                <p:fieldset id="fsStatus" legend="Escolha Status">
                                    <p:fieldset id="fdStatusCli" legend="Status Cliente">
                                        <p:selectManyCheckbox id="lineDirection1" value="#{exportarBean.selectedCliente}" >
                                            <f:selectItem itemLabel="Ativo" itemValue="A" />
                                            <f:selectItem itemLabel="Inativo" itemValue="I" />
                                            <f:selectItem itemLabel="Prospect" itemValue="P" />
                                        </p:selectManyCheckbox>
                                    </p:fieldset>
                                    <br />
                                    <p:fieldset id="fdStatusEmp" legend="Status Empreendimento">
                                        <p:selectManyCheckbox id="lineDirection2" value="#{exportarBean.selectedEmpreendimento}" >
                                            <f:selectItem itemLabel="Ativo" itemValue="A" />
                                            <f:selectItem itemLabel="Inativo" itemValue="I" />
                                            <f:selectItem itemLabel="Prospect" itemValue="P" />
                                        </p:selectManyCheckbox>
                                    </p:fieldset>
                                    <br />
                                    <p:fieldset id="fdStatusProc" legend="Status Processo">
                                        <p:selectManyCheckbox id="lineDirectionProc" value="#{exportarBean.selectedProcesso}" >
                                            <f:selectItem itemLabel="Em Andamento" itemValue="A" />
                                            <f:selectItem itemLabel="Finalizado" itemValue="F" />
                                            <f:selectItem itemLabel="Não Contratado" itemValue="N" />
                                        </p:selectManyCheckbox>
                                    </p:fieldset>
                                    <br />
                                    <p:fieldset id="fdStatusOs" legend="Status Ordem de Serviço">
                                        <p:selectManyCheckbox id="lineDirection3" value="#{exportarBean.selectedOs}" >
                                            <f:selectItem itemLabel="Em Andamento" itemValue="8" />
                                            <f:selectItem itemLabel="Finalizada" itemValue="A" />
                                            <f:selectItem itemLabel="Cancelada" itemValue="0" />
                                        </p:selectManyCheckbox>
                                    </p:fieldset>
                                    <br />
                                    <p:fieldset legend="Tipo de Documento - STATUS ETAPAS">
                                        <p:selectManyCheckbox id="fdStatusEtapa" value="#{exportarBean.selectedEtapa}" columns="2" layout="grid">
                                            <f:selectItem itemLabel="[A] Faturar" itemValue="A" />
                                            <f:selectItem itemLabel="[F]aturado não Pago" itemValue="F" />
                                            <f:selectItem itemLabel="Faturado [P]ago" itemValue="P" />
                                            <f:selectItem itemLabel="[C]ancelado" itemValue="C" />
                                        </p:selectManyCheckbox>
                                    </p:fieldset>
                                </p:fieldset>
                            </p:column>
                            <p:column style="text-align: left; vertical-align: text-top;">
                                <p:fieldset id="fsFiltro" legend="Escolha de Filtros">
                                    <p:fieldset legend="Empresa">
                                        <p:pickList id="pojoPickEmpresa" value="#{exportarBean.empresaPicks}" var="empresa" styleClass="p1"
                                                    itemValue="#{empresa}" itemLabel="#{empresa.nomEmpresa}" converter="empresaConverter2"
                                                    showCheckbox="true" addAllLabel="Adiciona Todos" addLabel="Adiciona os Selecionados"
                                                    showSourceFilter="true" showTargetFilter="true" filterMatchMode="contains" removeAllLabel="Remove Todos" removeLabel="Remove Selecionados" >

                                            <f:facet name="sourceCaption">Origem</f:facet>
                                            <f:facet name="targetCaption">Destino</f:facet>

                                            <p:column>
                                                <h:outputText value="#{empresa.nomEmpresa}" />
                                            </p:column>
                                        </p:pickList>
                                    </p:fieldset>
                                    <br />
                                    <p:fieldset legend="Faixa Data Emissão O.S.">
                                        <h:panelGrid columns="4">
                                            <h:outputText value="De: " />
                                            <p:inputMask id="imDatInicEmiss" value="#{exportarBean.datinicemiss}" mask="99/99/9999" style="font-weight:bold; width: 100px;" title="Deixe em Branco para todos!">
                                                <f:convertDateTime type="date" dateStyle="short" pattern="dd/MM/yyyy" locale="pt-BR"/>
                                            </p:inputMask>

                                            <h:outputText value=" Até:" />
                                            <p:inputMask id="imDatFimEmiss" value="#{exportarBean.datfimemiss}" mask="99/99/9999" style="font-weight:bold; width: 100px;" title="Deixe em Branco para todos!">
                                                <f:convertDateTime type="date" dateStyle="short" pattern="dd/MM/yyyy" locale="pt-BR"/>
                                            </p:inputMask>
                                        </h:panelGrid>
                                    </p:fieldset>
                                    <br />
                                    <p:fieldset legend="Faixa Data Emissão Etapa">
                                        <h:panelGrid columns="4">
                                            <h:outputText value="De: " />
                                            <p:inputMask id="imDatInicEmissEtapa" value="#{exportarBean.datinicemissetapa}" mask="99/99/9999" style="font-weight:bold; width: 100px;" title="Deixe em Branco para todos!">
                                                <f:convertDateTime type="date" dateStyle="short" pattern="dd/MM/yyyy" locale="pt-BR"/>
                                            </p:inputMask>

                                            <h:outputText value=" Até:" />
                                            <p:inputMask id="imDatFimEmissEtapa" value="#{exportarBean.datfimemissetapa}" mask="99/99/9999" style="font-weight:bold; width: 100px;" title="Deixe em Branco para todos!">
                                                <f:convertDateTime type="date" dateStyle="short" pattern="dd/MM/yyyy" locale="pt-BR"/>
                                            </p:inputMask>
                                        </h:panelGrid>
                                    </p:fieldset>
                                    <br />
                                    <p:fieldset legend="Faixa Data de Vencimento">
                                        <h:panelGrid columns="6">
                                            <h:outputText value="De: " />
                                            <p:inputMask id="imDatInic" value="#{exportarBean.datinicvenc}" mask="99/99/9999" style="font-weight:bold; width: 100px;" title="Deixe em Branco para todos!">
                                                <f:convertDateTime type="date" dateStyle="short" pattern="dd/MM/yyyy" locale="pt-BR"/>
                                            </p:inputMask>

                                            <h:outputText value=" Até:" />
                                            <p:inputMask id="imDatFim" value="#{exportarBean.datfimvenc}" mask="99/99/9999" style="font-weight:bold; width: 100px;" title="Deixe em Branco para todos!">
                                                <f:convertDateTime type="date" dateStyle="short" pattern="dd/MM/yyyy" locale="pt-BR"/>
                                            </p:inputMask>
                                        </h:panelGrid>
                                    </p:fieldset>
                                    <br />
                                    <p:fieldset legend="Faixa Data de Pagamento">
                                        <h:panelGrid columns="4">
                                            <h:outputText value="De: " />
                                            <p:inputMask id="imDatInicPgto" value="#{exportarBean.datinicpgto}" mask="99/99/9999" style="font-weight:bold; width: 100px;" title="Deixe em Branco para todos!">
                                                <f:convertDateTime type="date" dateStyle="short" pattern="dd/MM/yyyy" locale="pt-BR"/>
                                            </p:inputMask>

                                            <h:outputText value=" Até:" />
                                            <p:inputMask id="imDatFimPgto" value="#{exportarBean.datfimpgto}" mask="99/99/9999" style="font-weight:bold; width: 100px;" title="Deixe em Branco para todos!">
                                                <f:convertDateTime type="date" dateStyle="short" pattern="dd/MM/yyyy" locale="pt-BR"/>
                                            </p:inputMask>
                                        </h:panelGrid>
                                    </p:fieldset>
                                </p:fieldset>
                            </p:column>
                        </p:row>
                    </p:panelGrid>
                </p:panel>

                <p:commandButton id="excel" title="Clique para Gerar os Dados Escolhidos" value="Gerar Dados para Exportar" update=":frmExportar:panel :frmExportar:messages"
                                 rendered="#{exportarBean.botaogerar}" actionListener="#{exportarBean.geraDados}" icon="ui-icon-shuffle" onstart="PF('statusDialog').show();" />

                <p:commandButton id="excelGrava" title="Clique para Gravar Planilha Excel" value="Exportar para Excel" ajax="false" onstart="PF('statusDialog').show();"  
                                 rendered="#{exportarBean.botaoexportar}" actionListener="#{exportarBean.geraPlanilha}" icon="ui-icon-disk" update=":frmExportar:panel :frmExportar:messages">
                    <p:fileDownload value="#{exportarBean.exportFile}" contentDisposition="attachment" />
                </p:commandButton>

                <!-- GRID EXPORTAR -->
                <p:dataTable id="tabExportar" widgetVar="wtabExportar" var="exportar" value="#{exportarBean.exportarList}" 
                             paginator="true" rows="10" paginatorPosition="top" rendered="#{exportarBean.abregrid}"
                             emptyMessage="Nenhum Registro Retornado ..." filterEvent="enter" resizableColumns="true">

                    <p:columnGroup type="header">
                        <p:row>
                            <p:column headerText="Empresa" rendered="#{exportarBean.empresa}" />
                            <p:column headerText="No.O.S." rendered="#{exportarBean.numos}" />
                            <p:column headerText="Numero Processos" rendered="#{exportarBean.numprocesso}" />
                            <p:column headerText="Orgão" rendered="#{exportarBean.orgao}" />
                            <p:column headerText="Assunto" rendered="#{exportarBean.assunto}" />
                            <p:column headerText="Situação Processos" rendered="#{exportarBean.statusprocesso}" />
                            <p:column headerText="Razão Social/Nome" rendered="#{exportarBean.razsoc}" />
                            <p:column headerText="Nome Fantasia/Sobrenome" rendered="#{exportarBean.fantasia}" />
                            <p:column headerText="C.N.P.J./C.P.F." rendered="#{exportarBean.cnpjcliente}" />
                            <p:column headerText="Empreendimento" rendered="#{exportarBean.empreendimento}" />
                            <p:column headerText="C.N.P.J./C.P.F." rendered="#{exportarBean.cnpjempreendimento}" />
                            <p:column headerText="Descrição Proposta" rendered="#{exportarBean.dscproposta}" />
                            <p:column headerText="ETAPA" rendered="#{exportarBean.etapa}" />
                            <p:column headerText="ASSUNTO" rendered="#{exportarBean.assuntoos}" />
                            <p:column headerText="VALOR ETAPA" rendered="#{exportarBean.vlretapa}" />
                            <p:column headerText="% Pagto" rendered="#{exportarBean.percpagto}"/>
                            <p:column headerText="Evento" rendered="#{exportarBean.evento}" />
                            <p:column headerText="Nota Fiscal" rendered="#{exportarBean.nf}" />
                            <p:column headerText="Data Emissão" rendered="#{exportarBean.datemiss}" />
                            <p:column headerText="Data Vencimento" rendered="#{exportarBean.datvcto}" />
                            <p:column headerText="Data Pagamento" rendered="#{exportarBean.datpagto}" />
                            <p:column headerText="Valor Bruto" rendered="#{exportarBean.vlrbruto}" />
                            <p:column headerText="Valor Juros" rendered="#{exportarBean.vlrjuros}" />
                            <p:column headerText="Valor Multa" rendered="#{exportarBean.vlrmulta}" />
                            <p:column headerText="Valor Recebido" rendered="#{exportarBean.vlrreceb}" />
                            <p:column headerText="Valor Terceiro" rendered="#{exportarBean.vlrterc}" />
                            <p:column headerText="Status Etapa" rendered="#{exportarBean.statusetapa}" />
                            <p:column headerText=" " style="width: 10px;" rendered="#{exportarBean.statusproposta}" />
                        </p:row>
                    </p:columnGroup>

                    <p:column style="text-align: left; vertical-align: text-top;" rendered="#{exportarBean.empresa}">
                        <h:outputText value="#{exportar.idProposta.idEmpresa.nomEmpresa}" />
                    </p:column>
                    <p:column style="text-align: center; vertical-align: text-top;" rendered="#{exportarBean.numos}">
                        <h:outputText value="#{exportar.idProposta.numOs}" />
                    </p:column>
                    <p:column style="text-align: center;" rendered="#{exportarBean.numprocesso}">
                        <ui:repeat value="#{exportar.idProposta.idEmpreendimento.empreendimentoLoteList}" var="processo">
                            <h:outputText value="#{processo.numProcesso}" style="display: list-item;"/>
                        </ui:repeat>
                    </p:column>
                    <p:column style="text-align: left;" rendered="#{exportarBean.orgao}">
                        <ui:repeat value="#{exportar.idProposta.idEmpreendimento.empreendimentoLoteList}" var="orgao">
                            <h:outputText value="#{orgao.dscOrgao}" style="display: list-item;"/>
                        </ui:repeat>
                    </p:column>
                    <p:column style="text-align: left; vertical-align: text-top;" rendered="#{exportarBean.assunto}">
                        <ui:repeat value="#{exportar.idProposta.idEmpreendimento.empreendimentoLoteList}" var="processo">
                            <h:outputText value=" #{processo.idAssunto.dscAssunto}" style="display: list-item;"/>
                        </ui:repeat>
                    </p:column>
                    <p:column style="text-align: center;" rendered="#{exportarBean.statusprocesso}">
                        <ui:repeat value="#{exportar.idProposta.idEmpreendimento.empreendimentoLoteList}" var="processo">
                            <h:outputText value="#{processo.dscStatus}" style="display: list-item;"/>
                        </ui:repeat>
                    </p:column>
                    <p:column style="text-align: left; vertical-align: text-top;" rendered="#{exportarBean.razsoc}">
                        <h:outputText value="#{exportar.idProposta.idCliente.nomCliente}" />
                    </p:column>
                    <p:column style="text-align: left; vertical-align: text-top;" rendered="#{exportarBean.fantasia}">
                        <h:outputText value="#{exportar.idProposta.idCliente.nomFantasia}" />
                    </p:column>
                    <p:column style="text-align: left; vertical-align: text-top;" rendered="#{exportarBean.cnpjcliente}">
                        <h:outputText value="#{exportar.idProposta.idCliente.numCpf}" />
                    </p:column>
                    <p:column style="text-align: left; vertical-align: text-top;" rendered="#{exportarBean.empreendimento}">
                        <h:outputText value="#{exportar.idProposta.idEmpreendimento.dscEmpreendimento}" />
                    </p:column>
                    <p:column style="text-align: left; vertical-align: text-top;" rendered="#{exportarBean.cnpjempreendimento}">
                        <h:outputText value="#{exportar.idProposta.idEmpreendimento.numCpfEmpreendimento}" />
                    </p:column>
                    <p:column style="text-align: left; vertical-align: text-top;" rendered="#{exportarBean.dscproposta}">
                        <h:outputText value="#{exportar.idProposta.dscProposta}" />
                    </p:column>
                    <p:column headerText="ETAPA" rendered="#{exportarBean.etapa}">
                        <h:outputText value="#{exportar.dscEtapa}" />
                    </p:column>
                    <p:column headerText="ASSUNTO" rendered="#{exportarBean.assuntoos}">
                        <h:outputText value="#{exportar.dscAssunto}" />
                    </p:column>
                    <p:column headerText="VALOR ETAPA" style="font-weight:bold; text-align: right;" rendered="#{exportarBean.vlretapa}">
                        <h:outputText value="#{exportar.vlrEtapa}" style="font-weight:bold; text-align: right;">
                            <f:convertNumber locale="pt_BR" pattern="###,###,##0.00" minFractionDigits="2" />
                        </h:outputText>
                    </p:column>

                    <p:column headerText="% Pagto" style="font-weight:bold; text-align: right;" rendered="#{exportarBean.percpagto}">
                        <h:outputText value="#{exportar.percEtapa}" converter="percentualConverter" />
                    </p:column>

                    <p:column headerText="Evento" style="font-weight:bold;" rendered="#{exportarBean.evento}">
                        <h:outputText value="#{exportar.dscPerc}" />
                    </p:column> 

                    <p:column headerText="Nota Fiscal" style="font-weight:bold; text-align: right;" rendered="#{exportarBean.nf}">
                        <h:outputText value="#{exportar.dscNfe}" />
                    </p:column>

                    <p:column headerText="Data Emissão" style="font-weight:bold; text-align: center;" rendered="#{exportarBean.datemiss}">
                        <h:outputText value="#{exportar.datEmissao}">
                            <f:convertDateTime type="date" dateStyle="short" pattern="dd/MM/yyyy" />
                        </h:outputText>
                    </p:column>

                    <p:column headerText="Data Vencimento" style="font-weight:bold; text-align: center;" rendered="#{exportarBean.datvcto}">
                        <h:outputText value="#{exportar.datVencNota}">
                            <f:convertDateTime type="date" dateStyle="short" pattern="dd/MM/yyyy" />
                        </h:outputText>
                    </p:column>

                    <p:column headerText="Data Pagamento" style="font-weight:bold; text-align: right;" rendered="#{exportarBean.datpagto}">
                        <h:outputText value="#{exportar.datPagamento}">
                            <f:convertDateTime type="date" dateStyle="short" pattern="dd/MM/yyyy" />
                        </h:outputText>
                    </p:column>

                    <p:column headerText="Valor Bruto" style="font-weight:bold; text-align: right;" rendered="#{exportarBean.vlrbruto}">
                        <h:outputText value="#{exportar.vlrProposta}">
                            <f:convertNumber locale="pt_BR" pattern="###,###,##0.00" minFractionDigits="2" />
                        </h:outputText>
                    </p:column>

                    <p:column headerText="Valor Bruto" style="font-weight:bold; text-align: right;" rendered="#{exportarBean.vlrjuros}">
                        <h:outputText value="#{exportar.vlrJuros}">
                            <f:convertNumber locale="pt_BR" pattern="###,###,##0.00" minFractionDigits="2" />
                        </h:outputText>
                    </p:column>

                    <p:column headerText="Valor Bruto" style="font-weight:bold; text-align: right;" rendered="#{exportarBean.vlrmulta}">
                        <h:outputText value="#{exportar.vlrMulta}">
                            <f:convertNumber locale="pt_BR" pattern="###,###,##0.00" minFractionDigits="2" />
                        </h:outputText>
                    </p:column>

                    <p:column headerText="Valor Recebido" style="font-weight:bold; text-align: right;" rendered="#{exportarBean.vlrreceb}">
                        <h:outputText value="#{exportar.vlrPago}">
                            <f:convertNumber locale="pt_BR" pattern="###,###,##0.00" minFractionDigits="2" />
                        </h:outputText>
                    </p:column>

                    <p:column headerText="Valor Terceiro" style="font-weight:bold; text-align: right;" rendered="#{exportarBean.vlrterc}">
                        <h:outputText value="#{exportar.vlrLiquido}">
                            <f:convertNumber locale="pt_BR" pattern="###,###,##0.00" minFractionDigits="2" />
                        </h:outputText>
                    </p:column>

                    <p:column headerText="Status Etapa" style="font-weight:bold; text-align: center;" rendered="#{exportarBean.statusetapa}">
                        <h:outputText value="#{exportar.dscOrdStatus}" />
                    </p:column>

                    <p:column style="width: 10px; height: 10px; background-color: #{exportar.idProposta.corStatus}; color: #ffffff;" rendered="#{exportarBean.statusproposta}" />
                </p:dataTable>

                <!-- TELA ESPERA CARREGAMENTO -->
                <p:dialog id="DialogStatus" widgetVar="statusDialog" header="Aguarde ... Carregadando os Dados ..." draggable="false" closable="false" 
                          onShow="pbAjax.start();" modal="true">
                    <p:graphicImage value="/design/ajaxloadingbar.gif" />
                    <br />
                    <h:outputText value="AGUARDE ... GERANDO OS DADOS ..." style="text-align: center; font-weight:bold;" />

                    <p:progressBar id="ajaxPB" widgetVar="pbAjax" ajax="true" value="#{exportarBean.progress}" labelTemplate="{value}%" styleClass="animated">
                        <p:ajax event="complete" listener="#{exportarBean.onComplete}" update=":frmExportar:panel :frmExportar:messages" />
                    </p:progressBar>
                </p:dialog>
            </p:panel>
        </h:form>
    </ui:define>

</ui:composition>
